<?php
/**
 * Created by PhpStorm.
 * User: Zhanghaiqiang
 * Date: 2019-12-28
 * Time: 14:46
 */

namespace Models\Candy;


use Models\Base\EloquentModel;

class Content extends EloquentModel
{
    const TABLE_NAME = "candy_content";
    protected $table = self::TABLE_NAME;

    const FILE_TYPE_VALUE_IMAGE = 1;
    const FILE_TYPE_VALUE_VIDEO = 2;

    const FILE_SOURCE_VALUE_ALIYUN  = 1;
    const FILE_SOURCE_VALUE_URL     = 2;
    const FILE_SOURCE_VALUE_MINI_STORAGE = 3;
    const FILE_SOURCE_VALUE_TENCENT = 4;

    public static function getFullTableTable(){
        return config('database.connections.mysql.prefix').self::TABLE_NAME;
    }

    const DB_FIELD_ID          = 'id';
    const DB_FIELD_DATE_ID     = 'date_id';
    const DB_FIELD_TITLE       = 'title';
    const DB_FIELD_SORT        = 'sort';
    const DB_FIELD_IS_PRIVATE  = 'is_private';
    const DB_FIELD_DESCRIPTION = 'description';
    const DB_FIELD_FILE_TYPE   = 'file_type';
    const DB_FIELD_FILE_SOURCE = 'file_source';
    const DB_FIELD_FILE_VALUE  = 'file_value';
    const DB_FIELD_CREATED_AT  = 'created_at';
    const DB_FIELD_UPDATED_AT  = 'updated_at';
    const DB_FIELD_DELETED_AT  = 'deleted_at';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        self::DB_FIELD_ID,
        self::DB_FIELD_DATE_ID,
        self::DB_FIELD_TITLE,
        self::DB_FIELD_SORT,
        self::DB_FIELD_IS_PRIVATE,
        self::DB_FIELD_DESCRIPTION,
        self::DB_FIELD_FILE_TYPE,
        self::DB_FIELD_FILE_SOURCE,
        self::DB_FIELD_FILE_VALUE,
        self::DB_FIELD_CREATED_AT,
        self::DB_FIELD_UPDATED_AT,
        self::DB_FIELD_DELETED_AT,
    ];
}